
///
/// class_reuse.dart
///

class Point {
  num x = 0, y = 0;
  void printInfo() => print('($x, $y)');
}

class Vector extends Point {
  num z = 0;
  @override
  void printInfo() => print('($x, $y, $z)');
}

// 实现 Point 接口
class Coordinate implements Point {
  @override
  num x = 0, y = 0; // 成员变量需要重新声明
  @override
  void printInfo() => print('($x, $y)'); // 成员函数需要重新声明实现
}

void main() {
  var xx = Vector();
  xx
    ..x = 1
    ..y = 2
    ..z = 3;
  xx.printInfo();

  var yy = Coordinate();
  yy
    ..x = 1
    ..y = 2;
  yy.printInfo();
  print(yy is Point);
  print(yy is Coordinate);
}


